package com.dstation.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dstation.domain.ClassificationInfo;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.Collection;
import java.util.List;

public interface ClassificationInfoMapper extends BaseMapper<ClassificationInfo> {

    int insertClassification(@Param("classification") ClassificationInfo classificationInfo, @Param("time") Timestamp time);

    Long selectClassificationNameRepeat(@Param("name") String classificationName);

    int updateClassification(@Param("classification") ClassificationInfo classificationInfo,@Param("time") Timestamp time);

    int deleteClassification(@Param("classificationId") long classificationInfoId);

    List<ClassificationInfo> selectAllChildClassification();

    List<ClassificationInfo> selectClassificationByParentId(@Param("parentId") long parentId);

    IPage<ClassificationInfo> selectClassification(@Param("search") String search, @Param("page") Page page);


    Long selectIdByName(@Param("name") String oldName);

    List<ClassificationInfo> selectChildClassificationById(@Param("id")Long id);

    List<ClassificationInfo> selectAllClassification();
}